package com.haima.sage.bigdata.api.frame.datatype.impl;

import com.haima.sage.bigdata.api.frame.datatype.DataTypeService;


public class FloatDataTypeService extends DataTypeService<Float> {
    @Override
    public Float trans(Object value) {
        if (value == null) {
            return null;
        }
        if (value instanceof Number) {
            return ((Number) value).floatValue();
        }
        String dist = value.toString().trim();
        if (dist.length() != 0) {
            return Float.parseFloat(dist);
        }
        return null;
    }

}
